<f:view xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:c="http://java.sun.com/jstl/core"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:sf="http://www.springframework.org/tags/faces"
  contentType="text/html" encoding="UTF-8">

  <sf:resourceGroup>
    <sf:resource path="/css/menu.css" />
  </sf:resourceGroup>

  <div id="menu">
    <span class="menuTitle">Menu</span>
    <c:set var="role" scope="view" value="xxx" />

    <c:if test="${currentUser.authorities[0] == 'ROLE_ADMIN'}">
      <span class="menuTitle">ADMIN</span>

      <h:form>
        <h:commandLink class="menuE" action="editSection">
          Edit Section
        </h:commandLink>
      </h:form>

      <h:form>
        <h:commandLink class="menuE" action="editAccount">
          Edit Account
        </h:commandLink>
      </h:form>

      <h:form>
        <h:commandLink class="menuE" action="editProduct">
            Edit Product
        </h:commandLink>
      </h:form>
    </c:if>
    <c:if test="${currentUser.authorities[0] == 'ROLE_BUYER'}">
      <span class="menuTitle">BUYER</span>
      <h:form>
        <h:commandLink class="menuE" action="main">
          Dashboard
        </h:commandLink>
      </h:form>
    </c:if>

    <c:if test="${currentUser.authorities[0] == 'ROLE_USER'}">
      <span class="menuTitle">USER</span>
    </c:if>

    <span class="menuTitle">Rubriques</span>
    <c:forEach items="${conversationScope.sections}" var="e">
      <h:form>
        <h:commandLink class="menuE" action="section" value="#{e.name}">
          <f:setPropertyActionListener value="#{e}"
            target="#{flowScope.selectedMenu2Row}" />
        </h:commandLink>
      </h:form>
    </c:forEach>
  </div>
</f:view>
